import $http from './request.js'
import { generateSignHeader } from './sign.js'
let signHeader = generateSignHeader();
// 查询用户信息
export function getUserInfo(data) {
  return $http.get('/user/user/info', data)
}
// 查看车企证件到日校验
export function getPopvehicle(userId, data) {
  return $http.get('/vehicle/wechat/pop/vehicle/')
}

// 查看车企用户认证
export function getAutoCompanyCert(userId, data) {
  return $http.get('/user/cert/autoCompanyCert/' + userId, data)
}

// 获取会员信息记录
export function getVipRecord() {
  return $http.get('/user/vipServiceRecord/getVipRecord')
}

// 获取手机验证码并验证是否注册
export function createCodeCheckRegister(mobile, data) {
  return $http.get('/user/createCodeCheckRegister/' + mobile, data, {
    noCheck: true,
	header: signHeader
  })
}

// 获取手机验证码
export function getMobileNumber(mobile, data) {
  return $http.get('/user/smsCode/' + mobile, data, {
    noCheck: true,
	header: signHeader
  })
}

// 忘记密码后，重设密码
export function resetPasswordV2(data) {
  return $http.post('/auth/login/v2/forgetPassword', data, {
    noCheck: true
  })
}

// 获取会员服务列表
export function getVipServiceInfo() {
  return $http.get('/user/vipServiceInfo/get')
}

// 是否可买会员
export function canBuy() {
  return $http.get('/user/vipServiceInfo/setting/get', {}, {
    noCheck: true
  })
}

// 修改用户信息
export function updateUserInfo(data) {
  return $http.post('/user/user/updateSimpleUser', data)
}

// 获取身份列表
export function getUserList(data) {
  return $http.get('/user/user/v2/getUserList', data)
}

// 更换身份
export function changeUser(data) {
  return $http.get('/auth/user/v2/changeUser', data)
}

// 获取获客介绍详情
export function getCompanyHookById(data) {
  return $http.get('/user/autoCompanyHook/getById', data)
}

// 获取车企专属获客宝二维码
export function getMpQrCodeById() {
  return $http.get('/user/autoCompanyHook/getMpQrCodeById')
}

// 获取子账号
export function userWithCompany(userId, data) {
  return $http.get('/user/subAccount/userWithCompany/' + userId, data)
}

// 获取客户列表
export function getCustomer(data) {
  return $http.get('/user/autoCompany/customer/page', data)
}

// 获取子账号可授权的订阅服务通知模板id
export function getWxNoticeTemplateId() {
  return $http.get('/user/subAccount/wxNoticeTemplateId')
}

//
export function addObj(obj) {
  return $http.post('/user/userBank/', obj, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
//获取银行卡列表
export function fetchList(data) {
	return $http.get('/user/userBank/userBankPage', data)
}
//删除银行卡
export function delObj(id, data) {
	return $http.del('/user/userBank/userBankDel/' + id, data)
}
export function putObj(obj) {
  return $http.put('/user/userBank/', obj, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
